<!DOCTYPE html>
<html style="font-size: 23.4375px;">
<head>
    <include file="./public/header.html"/>
<body style="font-size: 21.7589px;">
<div id="app">
    <div id="shadow" style="display: none;"></div>
    <header class="top">
		<span>用户登录</span> <!---->
        <div class="iconfont back" style="display: none;"></div>
        <a href="{:U('Index/index')}" class="iconfont back"></a>
	</header>
    <div data-v-7d0156c2="" class="main" s="[object Object]">
        <table data-v-7d0156c2="">
            <tbody data-v-7d0156c2="">
            <tr data-v-7d0156c2="">
                <td data-v-7d0156c2="">账号</td>
                <td data-v-7d0156c2="" colspan="2">
				  <input data-v-7d0156c2="" tag="帐号" type="text"style="width: 200px" placeholder="请输入账号" class="va63" name="username" id="uname">
				</td>
            </tr>
            <tr data-v-7d0156c2="">
                <td data-v-7d0156c2="">密码</td>
                <td data-v-7d0156c2="" colspan="2">
				<input data-v-7d0156c2="" tag="密码" type="password" placeholder="请输入密码" class="va63" name="password" id="pwd1"></td>
            </tr>
            <tr data-v-7d0156c2=""></tr>
            </tbody>
        </table>
        <a href="{:U('Index/register')}" class="forget fr" data-v-7d0156c2="">没有账号? 立即注册</a>
        <div data-v-7d0156c2="" class="loginBtn BTN"><a data-v-7d0156c2="" onclick="check()">立即登录</a></div>
        <ul data-v-7d0156c2="" id="usedList"></ul>
        <div data-v-7d0156c2="" class="sevice">
            <a data-v-7d0156c2="">登录遇到问题?</a>
        </div>
        <div class="_problemBox" data-v-7d0156c2="" style="display: none;">
            <div class="blackBg"></div>
            <div class="moreLayer">
                <ul>
                    <li><a href="{:U('Index/ResetPwd')}">忘记密码</a></li>
                </ul>
                <ul>
                    <li class="quxiao"><a>取消</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<div id="layermbox2" class="layermbox layermbox0 layermshow mma" index="2" style="display:none;"><div class="laymshade"></div><div class="layermmain"><div class="section"><div class="layermchild layermsg layermanim" style="fill:#ececec"><div class="layermcont"><span class="iconfont"></span>帐号不能为空</div></div></div></div></div>

<script>
    $(".sevice").click(function(){
        $("._problemBox").show();
    })
   $(".quxiao").click(function(){
       $("._problemBox").hide();
   })



function check(){
	uname = $("#uname").val().replace(/(^\s+)|(\s+$)/g,"");
	pawd = $("#pwd1").val();
	if(uname==""){
	//	$(".mma").show();
		alert('帐号不能为空');
		return false;
	}
	if(pawd==""){
		alert('密码不能为空');
		return false;
	}
	if(pawd.length <6 || pawd.length > 16){
	//	alert("密码应为6-16位字符");
	//	return false;
	}
	$.ajax({
		 type: "POST",
		 url: "{:U('Index/dologin')}",
		 data: {username:uname, pwd:pawd},
		 dataType: "json",
		 success: function(data){
			 if(data==1){
				alert("用户名不存在!");
				return false;
			 }else if(data==2){
				alert("密码错误!");
				return false;
			 }else{
			//	$("#form").submit();
				window.location.href="{:U('Index/index')}";
			 }
		 }
	 });
}
</script>